.macro SMCCC instr
	\instr	#0
	ldr	x4, [sp]
	stp	x0, x1, [x4, #0]
	stp	x2, x3, [x4, #16]
	ldr	x4, [sp, #8]
	cbz	x4, 1f /* no quirk structure */
	ldr	x9, [x4, #0]
	cmp	x9, #1
	b.ne	1f
	str	x6, [x4, 4]
1:	ret
.endm SMCCC instr

/*
 * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
 *		  unsigned long a3, unsigned long a4, unsigned long a5,
 *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
 *		  struct arm_smccc_quirk *quirk)
 */
    .globl __arm_smccc_smc
.type __arm_smccc_smc, "function"
	.cfi_startproc
__arm_smccc_smc:
	SMCCC	smc
	.cfi_endproc
